package com.tl.khadmin.controller;
 
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;

import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
 
import com.tl.khadmin.bean.OrderException;
import com.tl.khadmin.bean.Staff;
import com.tl.khadmin.page.Page;
import com.tl.khadmin.service.OrderExceptionIService; 
import com.tl.khadmin.util.CommonUtil;

/**
 * 异常订单
 * @author 123
 */
@RequestMapping(value = "/order/exception")
@RestController
public class OrderExceptionController {
	
	@Resource
	private OrderExceptionIService orderExceptionService; 

	@RequestMapping(value = "/showbypage")
	public Map<String, Page<OrderException>> showByPage(HttpSession session, @RequestParam Map<String, Object> params) { 
		Integer pageNum = Integer.parseInt(params.get("pageNum").toString());
		Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
		return CommonUtil.returnResultCodeJson("result", orderExceptionService.showByPage(session, pageNum, pageSize, params));
	}
	
	/**
	 * 异常订单恢复
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "/restore")
	@ResponseBody
	public String restore(Integer id) {
		return orderExceptionService.restore(id);
	}
	
}
